package com.mrbug.pulltodismisspager.example;

import com.mrbug.pulltodismisspager.PullToDismissPager;
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import ohos.app.Context;
import org.junit.Test;

/**
 * 单元测试类
 */
public class PullToDismissPagerTest {
    private Context context;

    /**
     * 获取context
     */
    public void initClass() {
        context = AbilityDelegatorRegistry.getAbilityDelegator().getCurrentTopAbility().getContext();
    }

    /**
     * 添加pager
     */
    @Test
    public void getViewPager() {
        initClass();
        PullToDismissPager pullToDismissPager = new PullToDismissPager(context);
        pullToDismissPager.addView();
        if (null!=pullToDismissPager.getViewPager()){
            System.out.println("addView----");
        }
    }
}